package com.netposa.datawarehouse.bodysearch.task;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ForkJoinPool;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TaskConfig {
   @Bean
   public ForkJoinPool forkJoinPool() {
      return new ForkJoinPool(Runtime.getRuntime().availableProcessors());
   }

   @Bean
   public Executor executor() {
      return Executors.newCachedThreadPool();
   }
}
